<template>
	<view class="container">
		<view class="center-box">
			<view class="title">
				请输入口令
			</view>
			<uni-easyinput class="uni-mt-5" trim="all" v-model="userpassword" placeholder="请输入口令">
			</uni-easyinput>

			<view class="text">
				请联系活动创建者获取口令
			</view>
			<view class="button" @click="signin">
				确定
			</view>
		</view>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				userpassword:"",
				password: "",
				code:""
			}
		},
		onLoad(options) {
			this.code=options.code
			this.password = options.password
			console.log(this.password, 'passwordpasswordpasswordpassword');
		},
		onShow() {
			this.init()
		},
		methods: {
			init() {


			},
				
			signin(){
				console.log(this.password,'上个页面的值');
				console.log(this.userpassword,'用户输入的值');
				if(this.password==this.userpassword){
					uni.redirectTo({
							url: "user-signIn?code=" + this.code
					});
				}else{
					uni.showToast({
						title: '签到码错误！',
						icon:"none",
						duration: 2000
					});
					
					
				}
				
			}
		}

	}
</script>
<style lang="scss" scoped>
	.container {
		min-height: 100vh;
		background-color: #f6f6f6;
		border: 1px solid rgba($color: #000000, $alpha: 0);

		.center-box {
			background-color: #FFFFFF;
			height: 30vh;
			padding: 30upx;
			width: 690upx;
			margin: 0 auto;
			border-radius: 30upx;
			margin-top: 35vh;

			.title {
				text-align: center;
				font-weight: 700;
				font-size: 30upx;
				height: 40upx;
				line-height: 40upx;
				margin-bottom: 20upx;

			}

			.text {
				font-size: 28upx;
				color: #999;
				margin-top: 20upx;
			}

			.button {
				color: #fff;
				font-size: 34upx;
				height: 85upx;
				display: flex;
				justify-content: center;
				align-items: center;
				background-color: #1e90ff;
				width: 100%;
				margin: 0 auto;
				margin-top: 30upx;
				border-radius: 10upx;
			}
		}




	}
</style>
